<?php

namespace app\api\validate;

use app\common\validate\BaseValidate;

class InsurancePolicyValidate extends BaseValidate
{

    protected $rule = [
        'product_id'     => 'require',
//        'card_pwd'       => 'require',
        'imgs'           => 'require',
        'imei'           => 'require',
        'contacts_name'  => 'require',
        'contacts_phone' => 'require',
    ];
    protected $message = [
        'product_id.require'     => '请选择产品',
        'card_pwd.require'       => '请输入卡密',
        'imgs.require'           => '请上传图片',
        'imei.require'           => '请输入串号',
        'contacts_name.require'  => '请输入联系人',
        'contacts_phone.require' => '请输入手机号',
    ];

    public function sceneAdd()
    {
        return $this->only(['product_id', 'card_pwd', 'imgs', 'imei', 'contacts_name', 'contacts_phone']);
    }

    public function sceneExchange()
    {
        return $this->only(['card_pwd', 'imgs', 'imei', 'contacts_name', 'contacts_phone']);
    }

}